import { useState ,useEffect} from 'react'
import axios from 'axios'
import Address from './Address'
function App() {
 const [address,setAddress]=useState([])
 const [showDialog,setShowDialog]=useState(false)
useEffect(()=>{
  async function getUserAddress() {
    
    const {data}=await axios.get('https://www.fastmock.site/mock/2993f6a9e277946ef51c9b947746cd4c/beer/address')
  /*  console.log([...data]); */
  if(data&&data.length>0){
    setAddress([...data])
   /*  console.log(data,[...data]); */
  }

    
  }
  getUserAddress()
})
  return (
    <div className="App">
    <Address address={address}></Address>
    </div>
  )
}

export default App
